<script type="text/javascript" src="/media/js/ui/ui.tabs.js"></script>
<script type="text/javascript" src="/media/js/validate.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $('#tabs').tabs();
        // running ExColor
        $("#form").validate({
            rules:{
                realname:'required',
                telephone:'number',
                email:'email',
                username:'required'
            },
            messages:{
                realname:'管理员真实姓名不能为空',
                telephone:'电话号码必须为数字',
                email:'邮件格式不对',
                username:'登陆账号不能为空'
            },
            invalidHandler: function(e, validator) {
                var errors = validator.numberOfInvalids();
                if (errors) {
                    var message = errors == 1
                        ? '您有<font color="green">1</font>处填写错误,请认真填写！'
                    : '您有 <font color="green">' + errors + ' </font>处填写错误,请认真填写！';
                    $("div.error #error-info").html(message);
                    $('div.success').hide();
                    $("div.error").show();
                } else {
                    $("div.error").hide();
                }
            }
        });
    });

</script>

<div id="page-layout"><div id="page-content">
        <div id="page-content-wrapper">
            <div class="inner-page-title">
                <h2>修改管理员信息</h2>
            </div>
            <?php echo Message::get(); ?>
            <div class="response-msg error ui-corner-all" style="display:none;">
                <span>错误提示</span><span id="error-info"></span>
            </div>
            <div id="tabs">
                <ul>
                    <li><a href="#tabs-1">基本内容</a></li>
                </ul>
                <form action="<?php echo URL::base() . 'admin/user/edit/' . $data['id_user'] ?>" method="post" enctype="multipart/form-data" class="forms" name="form" id="form">
                    <div id="tabs-1">

                        <ul>
                            <li>
                                <font style="font-weight: bold;color:#222222"> 账号：<span class="req">*</span></font>

                                <input type="text" tabindex="1" maxlength="255" value="<?php echo $data['username'] ?>" class="field text" name="username" />

                                <font style="font-weight: bold;color:#222222"> 密码：</font>

                                <input type="text" tabindex="1" maxlength="255" value="" class="field text" name="password" /><span class="req">留空即密码不改变</span>

                            </li>
                            <li>
                                <font style="font-weight: bold;color:#222222"> 密码提示：</font>

                                <input type="text" tabindex="1" maxlength="255" value="<?php echo $data['username'] ?>" class="field text small" name="passwordhint" />


                            </li>
                            <li>
                                <font style="font-weight: bold;color:#222222">姓名：<span class="req">*</span></font> 

                                <input type="text" tabindex="1" maxlength="255" value="<?php echo $data['realname'] ?>" class="field text" name="realname" />

                                <font style="font-weight: bold;color:#222222">邮件</font> 
                                <input type="text" tabindex="1" maxlength="255" value="<?php if($data['email']) echo $data['email'] ?>" class="field text" name="email" />

                            </li>
                            <li>
                                <font style="font-weight: bold;color:#222222"> 电话：</font>

                                <input type="text" tabindex="1" maxlength="255" value="<?php echo $data['telephone'] ?>" class="field text" name="telephone" />
                                <font style="font-weight: bold;color:#222222"> 启用：</font>
                                <select name="enabled">
                                    
                                    <?php if($data['enabled']) {?>
                                    <option value="1" selected="selected">是</option>
                                    <option value="0">否</option>
                                    <?php } else {?>
                                    <option value="1">是</option>
                                    <option value="0" selected="selected">否</option>
                                    <?php }?>

                                </select>
                            </li>
                        </ul>
                    </div>
                    <ul>
                        <li class="buttons" style=" text-align: center;">
                            <button class="ui-state-default ui-corner-all ui-button" type="submit" id="submit_btn"> 修改</button>
                        </li>
                    </ul>
                </form>
            </div>
            <div class="clearfix"></div>

<!--        <i class="note">* To see more boxes examples, like the ones above, visit for the menu, the Layout Options pages.</i>-->
            <?php echo View::factory('admin/system/system_left')->render(); ?>
            <div class="clear"></div>			
        </div>
        <div class="clear"></div>
    </div>
